package com.zkthink.ceres.applet.common.domin;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class PageDate implements Serializable {
    private static final long serialVersionUID = -1373549110861472857L;
    @ApiModelProperty(value = "页码(默认为1)")
    private Integer pageNum = 1;
    @ApiModelProperty(value = "每页数据量(默认为100)")
    private Integer pageSize = 100;
    @ApiModelProperty(value = "根据名称进行模糊匹配")
    private String keyword = "";

    /**
     * 通过page的值，获取到一个泛型费object的Page
     * @param page1
     * @return
     */
    public static Page copyPage(Page page1){
        Page page = new Page();
        page.setTotal(page.getTotal());
        page.setSize(page.getSize());
        page.setCurrent(page.getCurrent());
        page.setOrders(page.getOrders());
        page.setPages(page.getPages());
        return page;
    }
}